import Vue from 'vue'
import Router from 'vue-router'
import User from '../views/User.vue'
import FirstPage from '../views/FirstPage.vue'
import Sys from '../views/Sys.vue'
import Form from '../views/Form.vue'
import AddUser from '../views/AddUser.vue'
import TestSystem from '../views/TestSystem.vue'
import Teacher from '../views/Teacher.vue'
import Student from '../views/Student.vue'
import Grade from '../views/Grade.vue' 
import NoFound from '../views/NoFound.vue'
import Login from '../views/Login.vue'
import Nav from '../components/Nav.vue'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect:'/login'
    },
    {
      path:'/login',
      component:Login
    },
    {
      path:'/nav',
      component:Nav,
      children:[
        {
          path: '/nav',
          redirect:'/nav/user'
        },
        {
          path:'/nav/user',
          component:User,
          children:[
            {
              path:'/nav/user',
             redirect:'/nav/user/form'
            },
            {
              path:'/nav/user/testSystem',
              component:TestSystem,
              children:[
                {
                  path:'/nav/user/testSystem/teacher',
                  component:Teacher,
                },
                {
                  path:'/nav/user/testSystem/student',
                  component:Student,
                },
                {
                  path:'/nav/user/testSystem/grade',
                  component:Grade,
                }
              ]
            },
            {
              path:'/nav/user/form',
              component:Form
            },
            {
              path:'/nav/user/addUser',
              component:AddUser
            }
          ]
        },
        {
          path:'/nav/firstPage',
          component:FirstPage
        },
        {
          path:'/nav/sys',
          component:Sys
        },

      ]
    },
    {
      path:'*',
      redirect:'/noFound',
    },
    {
      path:'/noFound',
      component:NoFound
    }
   
  ]
})
